/* styles/review.css */

:root {
    --primary: #3498db;
    --primary-dark: #2980b9;
    --secondary: #e74c3c;
    --accent: #f39c12;
    --light: #ecf0f1;
    --dark: #2c3e50;
    --gray: #95a5a6;
    --success: #27ae60;
    --card-bg: rgba(255, 255, 255, 0.85);
    --glass-bg: rgba(255, 255, 255, 0.15);
    --shadow: 0 8px 32px rgba(31, 38, 135, 0.15);
    --transition: all 0.3s ease;
}

/* 匿名用户头像 */

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    background-color: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-avatar .initials {
    font-weight: 600;
    color: #64748b;
}


.review-container {
    max-width: 1000px;
    /* Adjust max-width to match the screenshot */
    margin: 2rem auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.product-info-card {
    background-color: var(--card-bg);
    box-shadow: var(--shadow);
    border-radius: 10px;
    padding: 2rem;
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.product-image-area {
    flex: 0 0 300px;
    /* Fixed width for image area */
    display: flex;
    justify-content: center;
    align-items: center;
}

.product-main-image {
    width: 100%;
    max-width: 280px;
    /* Adjust based on your image size */
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.product-details-area {
    flex: 1;
    /* Takes remaining space */
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.product-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.product-price-info,
.product-delivery-info,
.product-rating-info,
.product-spec-info {
    display: flex;
    align-items: baseline;
    gap: 15px;
    font-size: 1rem;
    color: #555;
}

.price-label,
.delivery-label,
.rating-label,
.spec-label {
    color: var(--gray);
    font-weight: 500;
    min-width: 40px;
}

.product-price {
    font-size: 1.6rem;
    font-weight: bold;
    color: var(--secondary);
}

.product-rating {
    color: var(--accent);
    font-weight: 500;
}

/* 星级css */
.product-stars {
    display: flex;
    align-items: center;
    gap: 2px;
}

.product-stars i {
    font-size: 1rem;
}

.product-stars i.filled {
    color: var(--accent);
}

.spec-content {
    flex: 1;
}

.current-item-note {
    background-color: #f0f8ff;
    /* Light blue background */
    border: 1px solid #cce5ff;
    color: #004085;
    padding: 10px 15px;
    border-radius: 5px;
    margin-top: 1rem;
    font-size: 0.9rem;
    line-height: 1.5;
}

.current-item-note i {
    margin-right: 5px;
    color: #007bff;
}

.review-section {
    background-color: var(--card-bg);
    box-shadow: var(--shadow);
    border-radius: 10px;
    padding: 2rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--primary);
    /* Underline effect */
    padding-bottom: 0.5rem;
    display: inline-block;
    /* Makes underline fit text */
}

.rating-summary {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.rating-score {
    color: #333;
    font-weight: 500;
}

.score-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--accent);
}

.stars i {
    color: #e0e0e0;
    /* Grey for empty stars */
    font-size: 1.2rem;
    margin-right: 2px;
}

.stars i.filled {
    color: var(--accent);
    /* Orange for filled stars */
}

.review-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 2rem;
}

.tag-item {
    background-color: #e9ecef;
    /* Light grey */
    color: #495057;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.tag-item:hover {
    background-color: #dae0e5;
}

.write-review-area {
    border-top: 1px dashed #ddd;
    padding-top: 2rem;
    margin-top: 2rem;
}

.review-prompt {
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.review-prompt i {
    color: var(--accent);
    margin-right: 8px;
}

.review-sub-prompt {
    font-size: 0.9rem;
    color: #777;
    margin-bottom: 1.5rem;
}

.review-form-group {
    margin-bottom: 1.5rem;
}

.review-form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--dark);
}

textarea {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    font-size: 1rem;
    min-height: 120px;
    resize: vertical;
    /* Allow vertical resizing */
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

.review-actions {
    display: flex;
    justify-content: space-between;
    /* 使项目两端对齐 */
    align-items: center;
    /* 垂直居中对齐 */
    gap: 1rem;
}

.anonymous-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: auto;
    /* 将匿名勾选框推到最左边 */
}

.anonymous-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.anonymous-checkbox label {
    font-size: 1rem;
    color: var(--dark);
    cursor: pointer;
}

.btn-upload-image,
.btn-submit-review {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.btn-upload-image {
    background-color: var(--gray);
    color: white;
}

.btn-upload-image:hover {
    background-color: #7f8c8d;
}

.btn-submit-review {
    background-color: var(--primary);
    color: white;
}

.btn-submit-review:hover {
    background-color: var(--primary-dark);
}

.btn-preview-images {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: var(--primary); /* 可以选择不同的颜色，例如蓝色 */
    color: white;
}

.btn-preview-images:hover {
    background-color: var(--primary-dark);
}

/* 新增：全部评论区域样式 */
.all-reviews-section {
    background-color: var(--card-bg);
    box-shadow: var(--shadow);
    border-radius: 10px;
    padding: 2rem;
}

.all-reviews-section .section-title {
    margin-bottom: 2rem;
    /* Give more space below the title */
}

.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    /* Space between individual reviews */
}

.review-item {
    background-color: #f8f9fa;
    /* Light background for each review */
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.reviewer-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1rem;
}

.reviewer-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
}

.reviewer-name {
    font-weight: bold;
    color: var(--dark);
}

.review-date {
    font-size: 0.85rem;
    color: var(--gray);
    margin-left: auto;
    /* Pushes date to the right */
}

.review-content {
    font-size: 1rem;
    color: #333;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.review-images {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 1rem;
}

.review-image-thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #eee;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.review-image-thumbnail:hover {
    transform: scale(1.05);
}

.no-reviews-message {
    text-align: center;
    color: var(--gray);
    padding: 2rem;
    font-size: 1.1rem;
}

@media (max-width: 768px) {
    .product-info-card {
        flex-direction: column;
        align-items: center;
    }

    .product-image-area {
        flex: none;
        width: 100%;
    }

    .product-main-image {
        max-width: 250px;
    }
} 

/* 图片预览区域 */
.image-previews {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 1.5rem;
    padding: 1rem;
    border: 1px dashed #ced4da;
    border-radius: 8px;
    background-color: #f8f9fa;
}

.preview-item {
    position: relative;
    width: 100px;
    height: 100px;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.preview-item .thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-item .remove-image {
    position: absolute;
    top: 2px;
    right: 2px;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1rem;
    cursor: pointer;
    line-height: 1;
    transition: background-color 0.3s ease;
}

.preview-item .remove-image:hover {
    background-color: rgba(255, 0, 0, 0.8);
}